package view.other
{
	import data.BulletProp;
	import data.TankProp;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	import manager.ObjDataManage;
	
	public class ArmsTip extends Sprite
	{
		private var txt:TextField;
		
		private var sprite:Sprite;
		
		public function ArmsTip()
		{
			super();
			initface();
		}
		
		public function show(type:String):void{
			var tp:TankProp = ObjDataManage.getInstance().getTankProp(type);
			var bp:BulletProp = ObjDataManage.getInstance().getBulletProp(tp.bulletType);
			txt.htmlText = "坦克型号：" + tp.name +"型\n" +
				"射击半径："+tp.shoutRadius+"\n" +
				"射击频率：每分钟"+int(60000/tp.shoutGap)+"发"+"\n" +
				"炮弹类型："+tp.bulletType+"型(杀伤力："+bp.art+")\n" +
				"旋转速度："+tp.rotateSpeed*30+"°/秒";
			sprite.width = txt.width;
			sprite.height = txt.height;
		}
		private function initface():void
		{
			sprite = new Sprite();
			this.addChild(sprite);
			sprite.graphics.beginFill(0x000000,0.3);
			sprite.graphics.drawRoundRect(0,0,200,100,10,5);
			sprite.graphics.endFill();
			
			txt = new TextField();
			this.addChild(txt);
			txt.defaultTextFormat = new TextFormat("宋体",14,0xffff00);
			txt.mouseEnabled = false;
			txt.autoSize = TextFieldAutoSize.LEFT;
		}
	}
}